import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_displaymode/flutter_displaymode.dart';
import 'package:flutter_displaymode/flutter_displaymode_platform_interface.dart';
import 'package:flutter_displaymode/flutter_displaymode_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterDisplaymodePlatform
    with MockPlatformInterfaceMixin
    implements FlutterDisplaymodePlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FlutterDisplaymodePlatform initialPlatform = FlutterDisplaymodePlatform.instance;

  test('$MethodChannelFlutterDisplaymode is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterDisplaymode>());
  });

  test('getPlatformVersion', () async {
    FlutterDisplaymode flutterDisplaymodePlugin = FlutterDisplaymode();
    MockFlutterDisplaymodePlatform fakePlatform = MockFlutterDisplaymodePlatform();
    FlutterDisplaymodePlatform.instance = fakePlatform;

    expect(await flutterDisplaymodePlugin.getPlatformVersion(), '42');
  });
}
